package com.kamistoat.meimeichatserveraggrement.protocol.login;

import com.kamistoat.meimeichatserveraggrement.protocol.Command;
import com.kamistoat.meimeichatserveraggrement.protocol.Packet;
import com.kamistoat.meimeichatserveraggrement.protocol.login.dto.ClientAddressDto;

/**
 * Client在线状态变换通知
 * 用处:
 * 1. 当一个用户上线时，通知其所有在线好友，更新他们的本地P2P通讯录
 * 2. 当一个用户下线时，通知其所有在线好友，更新他们的本地P2P通讯录
 */
public class ClientOnLineStatusNotice extends Packet {
    private String friendId;
    /**
     * 目标用户状态- 0在线 1下线
     */
    private Integer OnLineStatus;
    private ClientAddressDto clientAddressDto;

    public ClientOnLineStatusNotice() {
    }

    public ClientOnLineStatusNotice(Integer onLineStatus) {
        OnLineStatus = onLineStatus;
    }

    public String getFriendId() {
        return friendId;
    }

    public void setFriendId(String friendId) {
        this.friendId = friendId;
    }

    public Integer getOnLineStatus() {
        return OnLineStatus;
    }

    public void setOnLineStatus(Integer onLineStatus) {
        OnLineStatus = onLineStatus;
    }

    public ClientAddressDto getClientAddressDto() {
        return clientAddressDto;
    }

    public void setClientAddressDto(ClientAddressDto clientAddressDto) {
        this.clientAddressDto = clientAddressDto;
    }

    /**
     * 获取协议指令
     *
     * @return 返回指令值
     */
    @Override
    public Byte getCommand() {
        return Command.ClientOnLineStatusNotice;
    }
}
